const DEVICES_KEY = "DEVICES_INFO";

export const useDevicesCookie = () => {
  type Info = {
    token?: string;
    packageId: string;
    language: string;
    statusBarHeight: string;
  };

  const cookie = useCookie<Info | undefined>(DEVICES_KEY);

  const setInfo = (info: Info) => {
    cookie.value = info;
  };

  const removInfo = () => {
    cookie.value = undefined;
  };

  return {
    token: cookie.value?.token,
    packageId: cookie.value?.packageId,
    language: cookie.value?.language,
    statusBarHeight: cookie.value?.language,
    setInfo,
    removInfo,
  };
};
